<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>39 | 项目创建准备</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords"
	content="Modern Responsive web template, Bootstrap Web Templates, Flat Web Templates, Andriod Compatible web template, 
Smartphone Compatible web template, free webdesigns for Nokia, Samsung, LG, SonyErricsson, Motorola web design" />
<script type="application/x-javascript">
	
	 addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); } 

</script>
<!-- Bootstrap Core CSS -->
<link href="css/bootstrap.min.css" rel='stylesheet' type='text/css' />
<!-- Custom CSS -->
<link href="css/style.css" rel='stylesheet' type='text/css' />
<!-- Graph CSS -->
<link href="css/lines.css" rel='stylesheet' type='text/css' />
<link href="css/font-awesome.css" rel="stylesheet">
<!-- jQuery -->
<script src="js/jquery.min.js"></script>
<!-- Nav CSS -->
<link href="css/custom.css" rel="stylesheet">
<!-- Metis Menu Plugin JavaScript -->
<script src="js/metisMenu.min.js"></script>
<script src="js/custom.js"></script>
<!-- Graph JavaScript -->
<script src="js/d3.v3.js"></script>
<script src="js/rickshaw.js"></script>
<script type="text/javascript">
	window.onload = function() {
		var nowDate = new Date();
		var setStart = document.getElementById("setStart");
		setStart.value = nowDate.getFullYear() + "-"
				+ nowDate.getMonth() + "-" + nowDate.getDate() + " "
				+ nowDate.getHours() + ":" + nowDate.getMinutes();
		setStartSpan.innerHTML = nowDate.getFullYear() + "年"
				+ nowDate.getMonth() + "月" + nowDate.getDate() + "日 "
				+ nowDate.getHours() + ":" + nowDate.getMinutes();
	}
	
	function insertTitle(tValue, filename){  
		var t1 = tValue.lastIndexOf("\\");  
		var t2 = tValue.lastIndexOf(".");  
		if(t1 >= 0 && t1 < t2 && t1 < tValue.length){  
			document.getElementById(filename).value = tValue.substring(t1 + 1, t2);
		}  
	}
	
	function fun(filename) {
		name = document.getElementById(filename).value;
		if(name != null && name != "") {
			return true;
		} else {
			return false;
		}
	}
	
</script>
</head>
<body>
	<div id="wrapper">
		<!-- Navigation -->
		<!-- left.jsp -->
		<jsp:include page="left.jsp"></jsp:include>
		<div id="page-wrapper">

			<div class="xs">
				<h3>项目创建准备</h3>
				<h4>
					<a href="createProject">创建令号</a>
				</h4>
				<table class="table">
					<tr>
						<td>项目令号</td>
						<td>启动令</td>
						<td>交接单</td>
						<td>令号通知</td>
						<td>设计师任命</td>
						<td>启动会纪要</td>
					</tr>
					<c:forEach items="${undone}" var="p">
						<c:choose>
							<c:when test="${sessionScope.user.role.id == 2 }">
								<c:if test="${p.cpd_ps.id == sessionScope.user.id }">
									<tr>
										<td><a>${p.project_code }</a></td>
										<td><c:choose>
												<c:when test="${(p.startOrder == null || p.startOrder=='')}">
													<form action="uploadStartOrder" method="post"
														enctype="multipart/form-data">
														<input type="file" name="some" id="pTitle"
															onChange="if(this.value)insertTitle(this.value, 'filename1');" />
														<input type="hidden" name="project.id" value="${p.id}" />
														<input type="hidden" name="someFileName" id="filename1" />
														<input type="hidden" name="flag" value="startorder" />
														<button type="button"
															onclick="fun('filename1') ? this.form.submit() : alert('请选择一个文件')">上传</button>
													</form>
												</c:when>
												<c:otherwise>已导入</c:otherwise>
											</c:choose>
										</td>

										<td><c:choose>
												<c:when test="${(p.handover == null || p.handover=='')}">
													<form action="uploadStartOrder" method="post"
														enctype="multipart/form-data">
														<input type="file" name="some" id="pTitle"
															onChange="if(this.value)insertTitle(this.value, 'filename2');" />
														<input type="hidden" name="project.id" value="${p.id}" />
														<input type="hidden" name="someFileName" id="filename2" />
														<input type="hidden" name="flag" value="handover" />
														<button type="button"
															onclick="fun('filename2') ? this.form.submit() : alert('请选择一个文件')">上传</button>
													</form>
												</c:when>
												<c:otherwise>已导入</c:otherwise>
											</c:choose>
										</td>

										<td><c:choose>
												<c:when
													test="${(p.decreeNotice == null || p.decreeNotice=='')}">
													<form action="uploadStartOrder" method="post"
														enctype="multipart/form-data">
														<input type="file" name="some" id="pTitle"
															onChange="if(this.value)insertTitle(this.value, 'filename3');" />
														<input type="hidden" name="project.id" value="${p.id}" />
														<input type="hidden" name="someFileName" id="filename3" />
														<input type="hidden" name="flag" value="decreeNotice" />
														<button type="button"
															onclick="fun('filename3') ? this.form.submit() : alert('请选择一个文件')">上传</button>
													</form>
												</c:when>
												<c:otherwise>已导入</c:otherwise>
											</c:choose>
										</td>

										<td><c:choose>
												<c:when test="${(p.designer == null || p.designer=='')}">
													<form action="uploadStartOrder" method="post"
														enctype="multipart/form-data">
														<input type="file" name="some" id="pTitle"
															onChange="if(this.value)insertTitle(this.value, 'filename4');" />
														<input type="hidden" name="project.id" value="${p.id}" />
														<input type="hidden" name="someFileName" id="filename4" />
														<input type="hidden" name="flag" value="designer" />
														<button type="button"
															onclick="fun('filename4') ? this.form.submit() : alert('请选择一个文件')">上传</button>
													</form>
												</c:when>
												<c:otherwise>已导入</c:otherwise>
											</c:choose>
										</td>

										<td><c:choose>
												<c:when test="${(p.summary == null || p.summary=='')}">
													<form action="uploadStartOrder" method="post"
														enctype="multipart/form-data">
														<input type="file" name="some" id="pTitle"
															onChange="if(this.value)insertTitle(this.value, 'filename5');" />
														<input type="hidden" name="project.id" value="${p.id}" />
														<input type="hidden" name="someFileName" id="filename5" />
														<input type="hidden" name="flag" value="summary" />
														<button type="button"
															onclick="fun('filename5') ? this.form.submit() : alert('请选择一个文件')">上传</button>
													</form>
												</c:when>
												<c:otherwise>已导入</c:otherwise>
											</c:choose>
										</td>
									</tr>
								</c:if>
							</c:when>
							<c:otherwise>
								<tr>
									<td><a>${p.project_code }</a></td>
									<td><c:choose>
											<c:when test="${(p.startOrder == null || p.startOrder=='')}">
												<form action="uploadStartOrder" method="post"
													enctype="multipart/form-data">
													<input type="file" name="some" id="pTitle"
														onChange="if(this.value)insertTitle(this.value, 'filename1');" />
													<input type="hidden" name="project.id" value="${p.id}" />
													<input type="hidden" name="someFileName" id="filename1" />
													<input type="hidden" name="flag" value="startorder" />
													<button type="button"
														onclick="fun('filename1') ? this.form.submit() : alert('请选择一个文件')">上传</button>
												</form>
											</c:when>
											<c:otherwise>已导入</c:otherwise>
										</c:choose>
									</td>

									<td><c:choose>
											<c:when test="${(p.handover == null || p.handover=='')}">
												<form action="uploadStartOrder" method="post"
													enctype="multipart/form-data">
													<input type="file" name="some" id="pTitle"
														onChange="if(this.value)insertTitle(this.value, 'filename2');" />
													<input type="hidden" name="project.id" value="${p.id}" />
													<input type="hidden" name="someFileName" id="filename2" />
													<input type="hidden" name="flag" value="handover" />
													<button type="button"
														onclick="fun('filename2') ? this.form.submit() : alert('请选择一个文件')">上传</button>
												</form>
											</c:when>
											<c:otherwise>已导入</c:otherwise>
										</c:choose>
									</td>

									<td><c:choose>
											<c:when
												test="${(p.decreeNotice == null || p.decreeNotice=='')}">
												<form action="uploadStartOrder" method="post"
													enctype="multipart/form-data">
													<input type="file" name="some" id="pTitle"
														onChange="if(this.value)insertTitle(this.value, 'filename3');" />
													<input type="hidden" name="project.id" value="${p.id}" />
													<input type="hidden" name="someFileName" id="filename3" />
													<input type="hidden" name="flag" value="decreeNotice" />
													<button type="button"
														onclick="fun('filename3') ? this.form.submit() : alert('请选择一个文件')">上传</button>
												</form>
											</c:when>
											<c:otherwise>已导入</c:otherwise>
										</c:choose>
									</td>

									<td><c:choose>
											<c:when test="${(p.designer == null || p.designer=='')}">
												<form action="uploadStartOrder" method="post"
													enctype="multipart/form-data">
													<input type="file" name="some" id="pTitle"
														onChange="if(this.value)insertTitle(this.value, 'filename4');" />
													<input type="hidden" name="project.id" value="${p.id}" />
													<input type="hidden" name="someFileName" id="filename4" />
													<input type="hidden" name="flag" value="designer" />
													<button type="button"
														onclick="fun('filename4') ? this.form.submit() : alert('请选择一个文件')">上传</button>
												</form>
											</c:when>
											<c:otherwise>已导入</c:otherwise>
										</c:choose>
									</td>

									<td><c:choose>
											<c:when test="${(p.summary == null || p.summary=='')}">
												<form action="uploadStartOrder" method="post"
													enctype="multipart/form-data">
													<input type="file" name="some" id="pTitle"
														onChange="if(this.value)insertTitle(this.value, 'filename5');" />
													<input type="hidden" name="project.id" value="${p.id}" />
													<input type="hidden" name="someFileName" id="filename5" />
													<input type="hidden" name="flag" value="summary" />
													<button type="button"
														onclick="fun('filename5') ? this.form.submit() : alert('请选择一个文件')">上传</button>
												</form>
											</c:when>
											<c:otherwise>已导入</c:otherwise>
										</c:choose>
									</td>
								</tr>
							</c:otherwise>
						</c:choose>
					</c:forEach>
				</table>
			</div>
		</div>
	</div>
	<div class="copy_layout">
		<jsp:include page="copyright.jsp"></jsp:include>
	</div>

	<!-- /#page-wrapper -->
	<!-- /#wrapper -->
	<!-- Bootstrap Core JavaScript -->
	<script src="js/bootstrap.min.js"></script>
</body>
</html>
